package com.goktech.service.imp;

import com.goktech.entity.Admin;
import com.goktech.entity.User;
import com.goktech.entity.inform;
import com.goktech.mapper.InformMapper;
import com.goktech.service.InformService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service("InformService")
public class informServiceImp implements InformService {

    @Autowired
    private InformMapper informMapper;

    @Override
    public List<Map<String, Object>> adminfindByAll(Admin admin, int begin, int end) {
        return informMapper.adminfindByAll(admin,begin,end);
    }

    @Override
    public List<Map<String, Object>> adminPublicAll(int begin, int end) {
        return informMapper.adminPublicAll(begin, end);
    }

    @Override
    public List<Map<String, Object>> adminPrivateByAll(Admin admin, int begin, int end) {
        return informMapper.adminPrivateByAll(admin,begin,end);
    }

    @Override
    public List<Map<String, Object>> adminfindSendZhanghao(@Param("zhanghao") String zhanghao,@Param("zhanghao") String zhanghao1) {
        return informMapper.adminfindSendZhanghao(zhanghao,zhanghao1);
    }

    @Override
    public List<Map<String, Object>> adminfindReceiverZhanghao(String adminZhanghao, String userZhanhao) {
        return informMapper.adminfindReceiverZhanghao(adminZhanghao,userZhanhao);
    }

    @Override
    public int insertPublic(inform i) {
        return informMapper.insertPublic(i);
    }

    @Override
    public List<Map<String, Object>> userfindByAll(User user, int begin, int end) {
        return informMapper.userfindByAll(user,begin,end);
    }

    @Override
    public List<Map<String, Object>> userfindByPrivate(User user, int begin, int end) {
        return informMapper.userfindByPrivate(user,begin,end);
    }

    @Override
    public List<Map<String, Object>> userfindSendZhanghao(Integer userId, String adminZhanghao) {
        return informMapper.userfindSendZhanghao(userId,adminZhanghao);
    }


}
